package com.sky.controller.admin;

import com.sky.entity.Employee;
import com.sky.entity.TestPojo;
import com.sky.mapper.EmployeeMapper;
import io.swagger.annotations.Api;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "测试接口", description = "测试用的接口")
@RestController
public class TestController {
    @Autowired
    private EmployeeMapper employeeMapper;

    @GetMapping("/test")
    public List<Employee> test() {
        List<Employee> test = employeeMapper.test();
        return test;
    }
    @PostMapping("/test")
    public String testPost(@RequestBody TestPojo testPojo) {
        return "name: " + testPojo.getName() + ", age: " + testPojo.getAge();
    }
}
